#size = std cell area / 0.65 + macro area / 0.82

#all cells area
set all_cells [dbGet top.insts.name * -p]
set all_cells_area 0
foreach cell $all_cells {
  set cell_area [dbGet ${cell}.area]
  set all_cells_area [expr $all_cells_area + $cell_area]
}

echo "The total area of al cells is $all_cells_area um^2"
#The total area of al cells is 2471926.37762 um^2


#macros area
set all_macros [dbGet top.insts.cell.subClass block -p2]
set all_macros_area 0
foreach macrocell $all_macros {
   set macro_area [dbGet ${macrocell}.area]
   set all_macros_area [expr $all_macros_area + $macro_area]
}

echo "The total macro area is $all_macros_area um^2 "
#The total macro area is 1165430.38561 um^2 



#std cells area
set std_cells_area [expr $all_cells_area -$all_macros_area]

echo "The total std cells area is $std_cells_area um^2"
#The total std cells area is 1306495.99201 um^2



#total_estimate_area
set total_estimate_area [expr $std_cells_area / 0.65 + $all_macros_area / 0.82]

echo "The estimated area is $total_estimate_area um^2"
#The estimated area is 3431250.40168 um^2



